<?php
error_reporting(E_ALL);
ini_set('display_errors', true);

require_once '../application/Env.php';

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/models'),
    get_include_path(),
)));

require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
//$autoloader->setFallbackAutoloader(true);

$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);

$bootstrap = $application->getBootstrap();
$bootstrap->bootstrap('db');
/* @var $dbAdapter Zend_Db_Adapter_Pdo_Sqlite */
$dbAdapter = $bootstrap->getResource('db');

Zend_Db_Table_Abstract::setDefaultAdapter($dbAdapter);
require_once 'Films.php';
$films = new Model_Films();

$dirs = scandir("F:\\");

foreach ($dirs AS $dir){
	/*$row = $films->createRow();
	$row->title = iconv('GB2312', 'UTF-8//IGNORE', $dir);
	$row->save();*/
	echo $dir;
	echo "\n";
}

//$row = $films->createRow();
//$row->title = rand(1, 1000);
//$row->save();
